<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'jsonce.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script src="jquery/jquery-1.10.2.js"></script>
	<script type="text/javascript" src="ckedit\ckeditor\ckeditor.js"></script>
	
	<script type="text/javascript">
	    window.onload = function()
	    {
	        CKEDITOR.replace( 'TextArea1' );
	    };
	</script>
	<script type="text/javascript">

		$(function () {
		var basePath = "<%=basePath%>";
		var ht='';
		    $("#btnget").click(function () {
		        $.ajax({
		            type: "post",
		            dataType: "json",
		            url: basePath+"Jsono",
		            success: function (data) {
		            //var jse=JSON.parse(data);
		           	$(data).each(function(i,value){
		           	ht=ht+"<tr>";
		           	ht=ht+ "<td> 学号："+value.id+"</td>";
		           	ht=ht+"<td> 姓名："+value.name+"</td>";
		           	ht=ht+"<td> 班级："+value.cla+"</td>";
		           	ht=ht+"<td> 性别："+value.sex+"</td>";
		           	ht=ht+"</tr>";
					//alert(value.id);
					//$("#xid").html(value.id);
		            });
		            $("#tb").html(ht);
		           }
		            
		        });
		    });
		});
	</script>

  </head>
  
  <body>  
		<table id="tb">
		  
		</table>
		<input id="btnget" type="button" value="加载数据" />
		<form action="<%=basePath%>UpDate" method="post" enctype="multipart/form-data">
		请选择你要上传的文件：<input type="file" name="upload" ><br>
		<input type="submit" value="提交"> 
		</form>
		<span>${message}</span>
		<textarea id="TextArea1" cols="20" rows="2" class="ckeditor"></textarea>
		
  </body>
</html>
